package zFactory;

import org.eclipse.emf.common.util.EList;

import bRM_LL73.BRM_LL73;
import pUNB.PUNB;
import node1.AbstractTask;
import srl90a03.Srl90a03;
import srl90a03.Srl90a03Factory;
import genArchi.Node;

public class NodeSrl90a03 implements NodeInterface
{

	/** 
	 * Attributes
	 * */
	private PUNB processorUtilization;
	private BRM_LL73 bound;
	private EList<AbstractTask> l_tasks;
	private boolean enableCreate;

	/**;/
	 * Constructor
	 */
	public NodeSrl90a03(EList<AbstractTask> l_tasks, BRM_LL73 bound, PUNB processorUtilization, boolean enableCreate) 
	{
		this.processorUtilization = processorUtilization;
		this.bound = bound;
		this.l_tasks = l_tasks;
		this.enableCreate = enableCreate;
	}

	/**
	 * 
	 */
	public Node createNode() 
	{
		/**/
		Srl90a03 _srl90a03 = Srl90a03Factory.eINSTANCE.createSrl90a03();

		/**/
		_srl90a03.setPU(this.processorUtilization);
		_srl90a03.setBound(this.bound);

		/**/
		for (AbstractTask atask : l_tasks)
		{
			srl90a03.Task task = Srl90a03Factory.eINSTANCE.createTask();
			task.setPeriod(atask.getPeriod());
			task.setBlocking(atask.getBlocking());

			_srl90a03.getTasks().add(task);	
		}
		
		return _srl90a03;
	}

	/**
	 * 
	 */
	public String getNodeName() 
	{
		return "srl90a03.impl.Srl90a03Impl";
	}

	/**
	 * 
	 */
	public void update(Node node) 
	{
		Srl90a03 _srl90a03 = (Srl90a03)node;
		/**/
		if (this.processorUtilization != null) _srl90a03.setPU(this.processorUtilization);
		if (this.bound != null) _srl90a03.setBound(this.bound);
	}

	@Override
	public boolean isEnable() 
	{
		return this.enableCreate;
	}

}